package com.epam.traning.taskmanager.content.bo;

import org.json.JSONException;
import org.json.JSONObject;

import com.epam.traning.taskmanager.content.bo.common.JSONModel;

public class Task extends JSONModel {

	private static final String ID = "id";
	
	private static final String NAME = "name";
	
	private static final String DESCRIPTION = "description";
	
	public Task() {
		super();
	}

	public Task(JSONObject jsonObject) {
		super(jsonObject);
	}

	public Task(String jsonString) {
		super(jsonString);
	}

	public String getName() {
		return getString(NAME);
	}
	
	public String getDescription() {
		return getString(DESCRIPTION);
	}
	
	public Long getId() {
		//TODO like string
		if (jo.isNull(ID)) {
			return null;
		}
		try {
			return jo.getLong(ID);
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	
	
}
